 var infowindow;
 var map;

  function initializeStartMap() {
	  
    var myLatlng = new google.maps.LatLng(57.70779280783442, 11.937975883483887);
    var myOptions = {
      zoom: 10,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    
   
    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    downloadUrl("js/startLocation.xml", function(data) {
    	//"js/moredata.xml"  "js/Location.xml"  C:/files/Location.xml
      var markers = data.documentElement.getElementsByTagName("marker");
      for (var i = 0; i < markers.length; i++) {
        var latlng = new google.maps.LatLng(parseFloat(markers[i].getAttribute("lat")),
                                    parseFloat(markers[i].getAttribute("lng")));
        var marker = createMarker(markers[i].getAttribute("name"), latlng);
       }
     });
    $('#auto-button').hide(); 
   $('#auto-button').trigger('onclick');
   
  }
  function createMarker(name, latlng) {
	    var marker = new google.maps.Marker({position: latlng, map: map});
	    google.maps.event.addListener(marker, "click", function() {
	      if (infowindow) infowindow.close();
	      infowindow = new google.maps.InfoWindow({content: name});
	      infowindow.open(map, marker);
	    });
	    
	    if(name =="BUS"){
	    	iconFile = 'images/black.png'; 
	    }
	    else if(name =="CAR"){
	    	iconFile = 'images/red.png'; 
	    }
	    else if(name =="BICYCLE"){
	    	iconFile = 'images/green.png'; 
	    }
	    else if(name =="WALKING"){
	    	iconFile = 'images/purple.png'; 
	    }
	    else if(name =="FERRY"){
	    	iconFile = 'images/blue.png'; 
	    }
	    else if(name =="TRAIN_SUBWAY_METRO"){
	    	iconFile = 'images/pink.png'; 
	    }
	    else if(name =="AEROPLANE"){
	    	iconFile = 'images/silver.png'; 
	    }
	    else if(name =="DESTINATION"){
	    	iconFile = 'images/check_flag.png'; 
	    }
	    
	    marker.setIcon(iconFile) ;
	    return marker;
	  }
  




  

  
